<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/30
 * Time: 14:28
 */
define('MCARD_TYPE0','年卡');
define('MCARD_TYPE1', '半年卡');
define('MCARD_TYPE2', '季卡');
define('MCARD_TYPE3', '月卡');
define('MCARD_EXPIRY0', '一年');
define('MCARD_EXPIRY1', '半年');
define('MCARD_EXPIRY2', '三个月');
define('MCARD_EXPIRY3', '一个月');
define('MCARD_STATE0', '未发布');
define('MCARD_STATE1', '销售中');
define('MCARD_STATE2', '已停售');

use think\Config;
function & load_wechat($type = '') {
    vendor('Wechat.Loader');
    static $wechat = array();
    $index = md5(strtolower($type));
    if (!isset($wechat[$index])) {
        $config = Config::get('wechat');
        //$config['cachepath'] = CACHE_PATH . 'Data/';
        $wechat[$index] = \Wechat\Loader::get($type, $config);
    }
    return $wechat[$index];
}